﻿using System.Windows;
using System.Windows.Forms;
using UserControl = System.Windows.Controls.UserControl;

namespace VMDS.GUIClient.Views.Management.Storages
{
    /// <summary>
    /// Interaction logic for MyModalDialog.xaml
    /// </summary>
    public partial class AddStorageDialog : UserControl
    {
        public AddStorageDialog()
        {
            InitializeComponent();
            Visibility = Visibility.Hidden;
        }

        private void OkButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Visibility = Visibility.Hidden;
        }

        private void CancelButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Visibility = Visibility.Collapsed;
            // TODO: Add event handler implementation here.
        }

        private void BrowseButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var dialog = new FolderBrowserDialog();
            dialog.SelectedPath = PathBox.Text;
            if (dialog.ShowDialog()==DialogResult.OK) PathBox.Text=dialog.SelectedPath;

        }

        private void root_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
        	PathBox.Text="";
			NameBox.Text="";
			// TODO: Add event handler implementation here.
        }

       

        private void root_IsVisibleChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e)
        {
			if (Visibility==Visibility.Visible){
        	PathBox.Text="";
			NameBox.Text="";
			}
        }

    }

}
